package com.ht.medicaltreatment.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.PatientFormBean

class CollectionRecordAdaptger:BaseQuickAdapter<PatientFormBean,BaseViewHolder>(R.layout.item_collection_form_layout) {
    override fun convert(holder: BaseViewHolder, item: PatientFormBean) {

        holder.setText(R.id.tvOrder,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvName,"${item.name}")
        //checkSuccess  0:未核验; 1:已核验; 2:核验中
        val tvStatus = holder.getView<TextView>(R.id.tvStatus)
        when(item.checkSuccess){
            0 -> {
                tvStatus.setTextColor(context.getColor(R.color.color97))
                tvStatus.setText("未核验")
            }

            1 -> {
                tvStatus.setTextColor(context.getColor(R.color.green))
                tvStatus.setText("已核验")
            }

            2 -> {
                tvStatus.setTextColor(context.getColor(R.color.yellow))
                tvStatus.setText("核验中")
            }
        }
    }

}
